PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Glossary

Apple event A high-level message that adheres to the interprocess messaging protocol on which AppleScript is based.

AppleScript A scripting language defined by Apple Computer, Inc., that allows you to control Macintosh computers without using the keyboard or mouse.

AppleScript command A command handled by AppleScript. AppleScript commands do not have to be included in Tell statements.

application command A command handled by an application or its objects. An application command must either be included in a Tell statement or include the name of the application in its direct parameter.

application object An object stored in an application or its documents and managed by the application.

Arbitrary Element reference form A reference form that specifies an arbitrary object in a container. If the container is a value, AppleScript uses a random-number generator to choose the object. If the container is an application object, the application chooses the object.

assignment statement A statement that assigns a value to a variable. Assignment statements begin with Set or Copy.

attachable application An application that can be customized by attaching scripts to specific objects in the application, such as buttons and menu items.

attaching a script to an application object The process of associating a script with a specific application object. Each application determines which, if any, of its objects can have scripts attached.

attribute A characteristic that can be considered or ignored in a Considering or Ignoring statement.

binary operator An operator that derives a new value from a pair of values.

Boolean A logical truth value. The two possible Boolean values are true and false . Boolean is an AppleScript value class.

Boolean expression An expression whose value can be either true or false .

chevrons See double angle brackets .

child script object A script object that inherits properties and handlers from another script object, called the parent.

Class The name of the AppleScript value class for a class identifier, a reserved word that specifies the class to which an object or value belongs. See also object class, value class.

coercion The process of converting a value from one class to another. For example, an integer value can be coerced into a real value. Also, the software that performs such a conversion.

command A word or phrase that requests an action. In AppleScript, there are four types of commands: AppleScript commands, application commands, scripting additions, and user-defined commands.

command handler A handler for an application or system command. Command handlers are similar to subroutines, but instead of defining responses to user-defined commands, they define responses to commands, such as Open, Print, or Move, that are sent to applications.

comment Descriptive text that is ignored by AppleScript when a script is executed.

compile In AppleScript, to convert a script from the form typed into a script editor to a form that can be used by AppleScript. The process of compiling a script includes syntax and vocabulary checks. A script is compiled when you first run it and again when you modify it and then run it again, save it, or check its syntax.

compiled script The form to which a script is converted when you compile it. The form of a compiled script is independent of the dialect in which a script is written.

complete reference A reference that has enough information to identify an object or objects uniquely. For a reference to an application object to be complete, its outermost container must be the application itself.

composite value A value that contains other values. AppleScript has three types of composite values: lists, records, and strings.

compound statement A statement that occupies more than one line and contains other statements. A compound statement begins with a reserved word indicating its function and ends with the word end .

conditional statement See If statement.

Considering statement A control statement that lists a specific set of attributes to be considered when AppleScript performs operations on strings or sends commands to applications.

constant A reserved word with a predefined value. A constant may be defined by AppleScript or by an application in its dictionary. Constant is an AppleScript value class.

container An object that contains one or more other objects, known as elements. You specify containers with the reserved words of or in .

continuation character A character (¬), entered by typing Option-L, used in the Script Editor to extend a statement to the next line.

control statement A statement that controls when and how one or more other statements are executed. AppleScript control statements include Tell, If, Repeat, Considering and Ignoring, With Timeout, and With Transaction.

current application Either the default target application or whatever application is currently set as a script's parent property.

current directory The folder or volume whose contents you can see when you choose Open, Save, or a related command from an application's File menu.

current script The script from which a user-defined command is executed.

Data An AppleScript value class used for data that do not belong to any of the other AppleScript value classes. In AppleScript, a value that belongs to the class Data can be stored in a variable, but cannot be manipulated.

Date An AppleScript value class used for a value that specifies a time, day of the month, month, and year.

declaration The first occurrence of a variable or property identifier in a script. The form and location of the declaration determine how AppleScript treats the identifier in that script--for example, as a property, global variable, or local variable.

default target The object that receives a command if no object is specified or if the object is incompletely specified in the command. Default targets are specified in Tell statements.

delegation The use of a Continue statement to call a handler in a parent script object or the current application.

dialect A version of the AppleScript language that resembles a specific human language or programming language. As of AppleScript version 1.3, English is the only dialect supported.

dictionary The set of commands, objects, and other words that are understood by a particular application or by a version of the system software. Each application or version of the system software has its own dictionary.

direct parameter The parameter immediately following a command.

double angle brackets Characters («») typically used by AppleScript to enclose raw data. You can enter double angle brackets, also known as chevrons, in a script by typing Option-Backslash and Shift-Option-Backslash.

element An object contained within another object, or a type of object that can be contained in another object. For example, a word object is an element of a paragraph object, but it is possible to have a paragraph with no words.

empty list A list with no items.

error expression An expression, usually a string, that describes an error.

error handler A collection of statements that are executed in response to an error message.

error message A message that is returned by an application, by AppleScript, or by the Macintosh Operating System if an error occurs during the handling of a command.

error number An integer that identifies an error.

evaluation The conversion of an expression to a value.

Every Element reference form A reference form that specifies every object of a particular class in a container.

Exit statement A statement used in the body of a Repeat statement to exit the Repeat statement.

explicit Run handler A handler at the top level of a script or a script object that begins with on run and ends with end . A single script or script object can include an explicit Run handler or an implicit Run handler, but not both.

expression In AppleScript, any series of words that has a value.

filter A phrase, added to a reference to a system or application object, that specifies elements in a container that match one or more conditions.

Filter reference form A reference form that specifies all objects in a container that match one or more conditions specified in a Boolean expression.

formal parameter See parameter variable.

global variable A variable that is available anywhere in the script in which it is defined.

handler A collection of statements that AppleScript executes in response to a command or an error message.

identifier A series of characters that identifies a value or handler in AppleScript. Identifiers are used to name variables, subroutines, parameters, properties, and commands.

ID reference form A reference form that specifies an object by the value of its ID property.

If statement A control statement that contains one or more Boolean expressions whose results determine whether to execute other statements within the If statement.

Ignoring statement A control statement that lists a specific set of attributes to be ignored when AppleScript performs operations on strings or sends commands to applications.

implicit Run handler All the statements at the top level of a script except for property declarations, script object definitions, and other command handlers. A single script or script object can include an explicit Run handler or an implicit Run handler, but not both.

Index reference form A reference form that specifies an object or location by describing its position with respect to the beginning or end of the container.

infinite loop A Repeat statement that does not specify when repetition stops.

inheritance The ability of a child script object to take on the properties and handlers of a parent script object.

initializing a script object The process of creating a script object from the properties and handlers listed in a script object definition. AppleScript creates a script object when it runs a script or handler that contains a script object definition.

insertion point An object class, supported by many applications, that specifies a place where another object or objects can be added.

integer A positive or negative number without a fractional part. In AppleScript, Integer is a value class.

International Text A value class that represents an ordered series of bytes, beginning with a four-byte language code and a four-byte script code which together determine the format of the bytes that follow.

item A value in a list or record. An item is specified by its offset from the beginning or end of the list or record.

labeled parameter A parameter that is identified by a label. See also positional parameter.

list An ordered collection of values. Lists are enclosed by braces. The values in a list are separated by commas. List is an AppleScript value class.

literal expression An expression that evaluates to itself.

local variable A variable that is available only in the handler in which it is defined. Variables that are defined within subroutines, command handlers, and error handlers are local unless they are explicitly declared as global variables.

log statement A script statement that reports the value of one or more variables to the Script Editor's Event Log window.

loop A series of statements that is repeated.

loop variable A variable whose value controls the number of times the statements in a Repeat statement are executed.

Middle Element reference form A reference form that specifies the middle object of a particular class in a container.

Name reference form A reference form that specifies an object by the value of its Name property.

nested control statement A control statement that is contained within another control statement.

Number A synonym for the AppleScript value classes Integer and Real.

object An identifiable part of an application, or thing within an application, that can respond to commands by performing actions.

object class A category for objects that share characteristics such as properties and element classes and respond to the same commands.

operand A value from which an operator derives another value.

operation An expression that derives a new value from one or more other values. An operator, such as the addition operator ( + ), concatenation operator ( & ), or Contents Of, determines how the new value is derived.

operator An AppleScript language element (a word, series of words, or symbol) used in an expression to derive a value from another value or pair of values.

optional parameter A parameter that need not be included for a command to be successful.

parameter variable An identifier in a subroutine definition that represents the actual value of a parameter when the subroutine is called. Also called formal parameter .

parent script object A script object from which another script object, called the child, inherits properties and handlers.

partial reference A reference that does not include enough information to identify an object or objects uniquely. When AppleScript encounters a partial reference, it uses the default object specified in the Tell statement to complete the reference.

positional parameter A subroutine parameter that is identified by the order in which it is listed. In a subroutine call, positional parameters are enclosed in parentheses and separated by commas. They must be listed in the order in which they appear in the corresponding subroutine definition.

property A characteristic of an object that has a single value and is identified by a label. See also script property.

Property reference form A reference form that specifies a property of an application object, record or script object.

Range reference form A reference form that specifies a series of objects of the same class in the same container.

raw data Data of type event, property, class, data, preposition, keyform, constant, or script that AppleScript displays between double angle brackets (or chevrons) because it cannot display the data in its native format.

real A number that can include a decimal fraction. Real is an AppleScript value class.

record An unordered collection of properties. Properties within a record are identified by labels that are unique within the record. Record is an AppleScript value class.

recordable application An application that uses Apple events to report user actions for recording purposes. When recording is turned on, the Script Editor creates statements corresponding to any significant actions you perform in a recordable application.

recursive subroutine A subroutine that calls itself.

reference A phrase that specifies one or more objects using the reference forms defined by AppleScript. Reference is an AppleScript value class.

reference form The syntax for referring to objects. AppleScript defines reference forms for Arbitrary Element, Every Element, Filter, ID, Index, Middle Element, Name, Property, Range, and Relative.

Relative reference form A reference form that specifies an object or location by describing its position in relation to another object, known as the base, in the same container.

Repeat statement A control statement that contains a series of statements to be repeated and, in most cases, instructions that specify when the repetition stops.

required parameter A parameter that must be included for a command to be successful.

reserved words The words in system and application dictionaries, including object and command names, constants, parameters, and properties.

result A value generated when a command is executed or an expression evaluated.

scope The range over which AppleScript recognizes a variable or property, which determines where else in a script you may refer to the same variable or property. The scope of a variable depends on where you declare it and whether you declare it as global or local. The scope of a property extends to the entire script or script object in which it is declared.

script A series of written instructions that, when executed, cause actions in applications and on the desktop.

scriptable application An application that can respond to application commands sent to it when an application such as Script Editor runs a script.

script application An application whose only function is to run the script associated with it.

script code A constant that identifies a particular script system for use on Macintosh computers.

script editor An application used to create and modify scripts.

Script Editor The script-editing application distributed with AppleScript.

scripting addition A file that provides additional commands or coercions you can use in scripts. Each scripting addition contains one or more command handlers. If a scripting addition is located in the Scripting Additions folder (in the Extensions folder of the System Folder), the command handlers it provides are available for use by any script whose target is an application on that computer.

script object A user-defined object in a script that combines data (in the form of properties) and potential actions (in the form of handlers).

script object definition A compound statement that contains a collection of properties, handlers, and other AppleScript statements. A script object definition begins with the reserved word script , followed by an optional variable name, and ends with the keyword end (or end script ).

script property A labeled container in which to store a value. Script properties are similar to variables, but they are persistent. Unlike variable values, script property values are saved when you save a script.

script system A collection of system software facilities that allow for the visual representation of a particular writing system. Script systems include Roman, Japanese, Hebrew, Greek, and Thai.

simple statement A statement that is contained on a single line and ends with a return character. See also compound statement.

simple value A value, such as an integer or a constant, that does not contain other values.

statement A series of AppleScript words, similar to an English sentence, that contains a request for an action or an expression to be evaluated. See also compound statement, simple statement.

string An ordered series of characters (a character string). String is an AppleScript value class.

Styled Text A synonym for the AppleScript value class String. A string referred to as Styled Text may include style and font information.

subroutine A collection of statements that is executed in response to a user-defined command.

suite A listing of the Apple event constructs (object class definitions, descriptor types, and so on) needed for performing a particular type of scriptable activity.

synonym An AppleScript word, phrase, or language element that has the same meaning as another AppleScript word, phrase, or language element. For example, the operator does not equal is a synonym for .

syntax The arrangement of words in an AppleScript statement.

syntax description A template for using a command or control statement in a script.

system object An object that is part of a scriptable element of the Mac OS, such as a theme object from the Appearance control panel.

target The recipient of a command. Potential targets include application objects, script objects, the current script, and the current application.

Tell statement A control statement that specifies the default target for the statements it contains.

test A Boolean expression that specifies the conditions of a filter or an If statement.

Text A synonym for the AppleScript value class String.

Try statement A two-part compound statement that contains a series of AppleScript statements, followed by an error handler to be invoked if any of those statements cause an error.

unary operator An operator that derives a new value from a single value.

Unicode An international standard that uses a 16-bit encoding to uniquely specify the characters and symbols for all commonly used languages.

Unicode Text A value class that represents an ordered series of two-byte Unicode characters.

user-defined command A command that triggers the execution of a collection of statements, called a subroutine, elsewhere in the same script.

value A type of data that can be manipulated by and stored in scripts. The AppleScript value classes include Boolean, Class, Constant, Data, Date, Integer, List, Real, Record, Reference, String, Unicode Text, and so on.

value class A category of values with similar characteristics. Values that belong to the same class respond to the same operators.

variable A named container in which to store a value.

With Timeout statement A control statement that allows you to change the amount of time AppleScript waits for application commands to complete before stopping execution of the script.

With Transaction statement A control statement that allows you to take advantage of applications that support the notion of a transaction--a sequence of related events that should be performed as if they were a single operation.


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)